﻿using System;
using System.Collections.Generic;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;

namespace FasterWPF
{
    /// <summary>
    ///  Implemented on any class that supports adding or removing Composites
    /// </summary>
    public interface IParent 
    {
        //A composite is added by key and args
        object Add<T>(object chain, string key, T args, System.Windows.Controls.Border itemToBind);
        void Remove(object chain, string key, Border itemToRemove); 
        List<Border> RetrieveCollection(object chain);
        Dictionary<string, object> RetrieveDictionary(object chain);
  }

    public interface ICanGenerate
    {
        object Generate<T>(object chain, T args, Action<System.Windows.Controls.StackPanel> addUIElementsAction);        
    }

    public interface ICanSelect
    {
        void SetSelected(object chain, System.Windows.Controls.Border itemToSetAsSelected);
    }
    
    public interface ICanSort
    {
        void ClearCollection(object chain);
        void BeforeSortCollection<T>(object chain, object args, int row, int column, FasterWPF.CommonExt.SortOrder sortOrder, CommonExt.SortControlType sortControlType)
             where T : FrameworkElement;
        void BeforeSortCollection1Then2<T>(object chain, object args, int row, int column, int row2, int column2, FasterWPF.CommonExt.SortOrder sortOrder, FasterWPF.CommonExt.SortOrder sortOrder2, CommonExt.SortControlType sortControlType)
             where T : FrameworkElement;
        void AfterSortCollection<T>(object chain)
             where T : FrameworkElement;
    }

    public interface ICanFilter
    { 
        //SEARCH/FIND/WHERE ?!?!

        T FilterByText<T>(T chain, int row, int column, Predicate<string> filterPredicate)
                      where T : FrameworkElement;
        T FilterByText1And2<T>(T chain, int row, int column, int row2, int column2, Predicate<Tuple<string, string>> filterPredicate)
                      where T : FrameworkElement;
        T FilterByText1And2And3<T>(T chain, int row, int column, int row2, int column2, int row3, int column3, Predicate<Tuple<string, string, string>> filterPredicate)
                      where T : FrameworkElement;
    }

}
